#!/bin/bash

export OPENBLAS_NUM_THREADS=1
export MKL_THREADING_LAYER=sequential


# mv model/final.mdl model/final.mdl.new 
# mv model/final.mdl.old model/final.mdl

model_name=$(realpath model/HCLG.fst | xargs dirname | xargs basename)

result_name=${model_name}

echo $model_name

# ./bin/online2_nnet3_pipeline_decoder_mcy "option.conf" "ark:/data/cfs/asr_data/meichaoyang001/audio/dabanhui/dabanhui_20211026/utt2spk" \
#         "scp:/data/cfs/asr_data/meichaoyang001/audio/dabanhui/dabanhui_20211026/wav.scp"  "model/${model_name}" > result/${result_name}.result

./bin/online2_nnet3_pipeline_decoder_mcy "option.conf" "ark:/data/cfs/asr_data/meichaoyang001/audio/dabanhui/dabanhui_20211229/utt2spk" \
        "scp:/data/cfs/asr_data/meichaoyang001/audio/dabanhui/dabanhui_20211229/wav.scp"  "model/${model_name}" "model/final.mdl.old"  > result_date1229/${result_name}.result
python bin/process_result.py result_date1229/${result_name}.result result_date1229/${result_name}.nofilter.hyp

python bin/filter.py result_date1229/base1229.lab result_date1229/${result_name}.nofilter.hyp result_date1229/${result_name}.hyp
# ./online2_nnet3_pipeline_decoder "option.conf" "ark:/data/cfs/asr_data/meichaoyang001/audio/dabanhui/dabanhui_20211026/utt2spk" \
#         "scp:/data/cfs/asr_data/meichaoyang001/audio/dabanhui/dabanhui_20211026/wav.scp"| python process_result.py > result/${model_name}.hyp

mkdir -p result_date1229/score
~/.tmp/jianwei_athena/tools/SCTK/bin/sclite -f 1 -i wsj -r result_date1229/base1229.lab \
    -h result_date1229/${result_name}.hyp -e utf-8 -o all -O result_date1229/score -f 1
